﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kristall.Engine;

namespace Kristall.Editor.Commands
{
    public class ResizeCommand : ICommand
    {
        int _oldWidth, _oldHeight, _newWidth, _newHeight;
        AABB _toResize;

        public ResizeCommand(AABB toResize, int width, int height)
        {
            this._toResize = toResize;
            this._oldHeight = _toResize.Bounds.Height;
            this._oldWidth = _toResize.Bounds.Width;
            _newHeight = height;
            _newWidth = width;
        }

        public bool Execute()
        {
            _toResize.SetSize(_newWidth, _newHeight);
            return true;
        }

        public bool Undo()
        {
            _toResize.SetSize(_oldWidth, _oldHeight);
            return true;
        }

        public string Name
        {
            get { return "Resize"; }
        }
    }
}
